package com.wecon.dianping.dal;

import com.wecon.dianping.model.Shop;
import com.wecon.dianping.model.ShopExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface ShopMapper {
    int countByExample(ShopExample example);

    int deleteByExample(ShopExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Shop record);

    int insertSelective(Shop record);

    List<Shop> selectByExample(ShopExample example);

    Shop selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Shop record, @Param("example") ShopExample example);

    int updateByExample(@Param("record") Shop record, @Param("example") ShopExample example);

    int updateByPrimaryKeySelective(Shop record);

    int updateByPrimaryKey(Shop record);

    List<Shop> selectAll();

    List<Shop> recommend(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude);

    List<Shop> search(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("keyword")String keyword,
                      @Param("categoryId")Integer categoryId, @Param("orderby")Integer orderby,
                      @Param("tags")String tags);

    List<Map<String, Object>> searchGroupByTags(@Param("keyword")String keyword, @Param("categoryId")Integer categoryId, @Param("tags")String tags);

}